﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<FillCartridgeBBB.Models.Move>" %>
<%@ Import Namespace="FillCartridgeBBB.Models" %>
<%= Html.ValidationSummary("Дані не збережено!") %>
            <div class="editor-label">
                Підрозділ
            </div>
            <div class="editor-field">
           <select id="Department" name="Department" onchange="return dropdown(this);" >
           <option  selected value = "0"> -- </option>
            <% foreach (var dep in (IEnumerable<Department>)ViewData["Departments"])
            {
                if (dep.DepartmentId == (int)ViewData["DepId"])
                {%>
                    <option selected value = "<%=dep.DepartmentId%>"><%=dep.Name%></option>
                    <%
                }
                else
                {%>
                    <option value = "<%=dep.DepartmentId %>"><%=dep.Name %></option>
                <%}%>
                    
                    
            <%}%>
            </select>
            <%= Html.ValidationMessage("Department", "*") %>
            </div>
            <div class="editor-label">
                Принтер
           </div>
            <div class="editor-field">
            
            <select id="Printer" name="Printer" onchange="return dropdown(this);" >
           <option selected value = "0"> -- </option>
            <% foreach (var prt in (IEnumerable<Printer>)ViewData["Printers"])
            {
                if (prt.PrinterId == (int)ViewData["PrtId"])
                {%>
                    <option selected value = "<%=prt.PrinterId%>"><%=prt.PrinterName%></option>
                    <%
                }
                else
                {%>
                    <option value = "<%=prt.PrinterId %>"><%=prt.PrinterName%></option>
                <%}%>
                    
                    
            <%}%>
            </select>
            <%= Html.ValidationMessage("Printer", "*") %>
            </div>
            <div class="editor-label">
                Картридж
            </div>
            <div class="editor-field">
            <input type="text" value="<%=ViewData["CartridgeName"] %>"/>
            </div>
            <div class="editor-label">
                Забрати
            </div>
            <div class="editor-field">
                <select id="OldCartridge" name="oldCartridge" onchange="return dropdown(this);" >
           <option selected value = "0"> -- </option>
            <% foreach (var crt in (IEnumerable<Cartridge>)ViewData["OldCartridges"])
            {
                if (crt.CartridgeId == (int)ViewData["OldCartId"])
                {%>
                    <option selected value = "<%=crt.CartridgeId%>"><%=crt.SerialNumber%></option>
                    <%
                }
                else
                {%>
                    <option value = "<%=crt.CartridgeId%>"><%=crt.SerialNumber%></option>
                <%}%>
                    
                    
            <%}%>
            </select>
            <%= Html.ValidationMessage("OldCartridge", "*") %>
            </div>
             <div class="editor-label">
                Поставити
            </div>
            <div class="editor-field">
                <select id="NewCartridge" name="NewCartridge" onchange="return dropdown(this);" >
           <option selected value = "0"> -- </option>
            <% foreach (var crt in (IEnumerable<Cartridge>)ViewData["NewCartridges"])
            {
                if (crt.CartridgeId == (int)ViewData["NewCartId"])
                {%>
                    <option selected value = "<%=crt.CartridgeId%>"><%=crt.SerialNumber%></option>
                    <%
                }
                else
                {%>
                    <option value = "<%=crt.CartridgeId%>"><%=crt.SerialNumber%></option>
                <%}%>
                    
                    
            <%}%>
            </select>
            <%= Html.ValidationMessage("NewCartridge", "*") %>
        </div>
        <div class="editor-label">
            <input type="Button" value = "Зберегти" onclick = "return createMov(); " />
       </div>

<input id = "operation" name="operation" type="hidden" value ="Select" />
<input type="submit"  id = "go" name = "go" visible = "false" style="display:none;"/>



            